package com.tang.plugin.utils;

import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;

public class NotificationUtils {

    private static final String DEFAULT_TITLE = "Notification";
    private static final String DEFAULT_GROUP_ID = "Untitled_Group";

    public static void showError(String msg) {
        showError(msg, DEFAULT_TITLE);
    }

    public static void showError(String msg, String title) {
        getError(msg, title);
    }

    private static void getError(String msg, String title) {
        getError(msg, title, DEFAULT_GROUP_ID);
    }

    private static void getError(String msg, String title, String groupId) {
        Notification notification = new Notification(groupId, title, msg, NotificationType.ERROR);
        notification.setImportant(true);
        Notifications.Bus.notify(notification, null);
    }


}
